package cn.frank.web;

import cn.frank.vo.TotalEntry;
import cn.frank.service.oracle.ITJ_JL_DYBD_RIService;
import cn.frank.vo.LineShow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Frank
 * @date 05-31
 */
@RestController
@RequestMapping("/dzwz/inner")
public class InnerController {

    @Autowired
    private ITJ_JL_DYBD_RIService riService;

    @GetMapping("/showRefreshTotal")
    public Map<String,Object> showRefreshTotal(){
        Map<String, Object> dayDybd = riService.findDayDybd();
        dayDybd.put("code","200");
        dayDybd.put("msg","success");
        return dayDybd;
    }

    @GetMapping("/showMonthData")
    public Map<String,Object> showMonthData(){
        Map<String, Object> dayofMonth = new HashMap<>();
        //List<InnerShow> innerShows = riService.findMonthDybd();
        List<LineShow> lineShows = riService.findMonthTjbd();
        List<TotalEntry> totalEntries = riService.findRiDayOfTime();
        dayofMonth.put("rdata", lineShows);
        dayofMonth.put("tdata",totalEntries);
        dayofMonth.put("code","200");
        dayofMonth.put("msg","success");
        //dayDybd.put("data",riService.findMonthDybd());
        return dayofMonth;
    }
}
